package com.mingyizhudao.app.view;

import java.util.Timer;
import java.util.TimerTask;

import com.igexin.sdk.PushManager;
import com.mingyizhudao.app.R;
import com.mingyizhudao.app.utils.CommonUtils;

import android.content.Intent;
import android.content.res.Configuration;
import android.content.res.Resources;
import android.os.Bundle;

public class SplashActivity extends MYBaseActivity {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_splash);
		
		
		Resources resource = getResources();

		Configuration c =resource.getConfiguration();

		c.fontScale = 1.0f;

		resource.updateConfiguration(c, resource.getDisplayMetrics());
		initView();
	}

	private void initView() {
		Timer tExit = new Timer();
		tExit.schedule(new TimerTask() {
			@Override
			public void run() {
				Intent intent = new Intent();
				boolean needShow =true;
				if (needShow &&!"1".equals(CommonUtils.getIsShowedGuide(SplashActivity.this)) ) {
					intent.setClass(SplashActivity.this, GuideActivity.class);
				}else {
					intent.setClass(SplashActivity.this, MainActivity.class);
				}
				startActivity(intent);
				finish();
			}
		}, 2000);

	}

	@Override
	public void initHeaderView() {

	}
	@Override 
	protected void onResume() { 
		super.onResume(); 
	} 
	@Override 
	protected void onPause() { 
		super.onPause(); 
	}
}
